import { request } from '@/utils/request.js'

/**
 * 托盘 API JS
 */

export default {
  /**
   * 托盘组列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'sea/waybillTrayList/index',
      method: 'get',
      params
    })
  },
  /**
   * 托盘组列表
   * @returns
   */
  list (params = {}) {
    return request({
      url: 'sea/waybillTrayList/list',
      method: 'get',
      params
    })
  },
    /**
   * 统计导出
   * @returns
   */
    totalExecl (params = {}) {
      return request({
        url: 'sea/waybillTrayList/totalExecl',
        method: 'get',
        responseType: 'blob',
        params
      })
    },
  /* 读取托盘组详情
  * @returns
  */
  read (id) {
   return request({
     url: 'sea/waybillTrayList/read/' + id,
     method: 'get',
   })
 }, 
  //托盘接收
  recived (data = {}) {
    return request({
      url: 'sea/waybillTrayList/recived',
      method: 'put',
      data
    })
  },

  /**
   * 添加
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'sea/waybillTrayList/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'sea/waybillTrayList/update/' + data.id,
      method: 'put',
      data
    })
  },
    /**
   * 托盘运单绑定关系
   * @returns
   */
    trayShipment (data = {}) {
      return request({
        url: 'sea/waybillTrayList/trayShipment',
        method: 'post',
        data
      })
    },
      /**
   * 托盘运单绑定关系
   * @returns
   */
      closeTap (data = {}) {
        return request({
          url: 'sea/waybillTrayList/close',
          method: 'post',
          data
        })
      },

        /**
   * 托盘运单绑定出库单
   * @returns
   */
        taskTap (data = {}) {
          return request({
            url: 'sea/waybillTrayList/task',
            method: 'post',
            data
          })
        },
      /**
   * 托盘运单移出出库单
   * @returns
   */
      deleteTask (data = {}) {
        return request({
          url: 'sea/waybillTrayList/deleteTask',
          method: 'post',
          data
        })
      },
   /**
   * 托盘运单上车
   * @returns
   */
   carin (data = {}) {
    return request({
      url: 'sea/waybillTrayList/carin',
      method: 'post',
      data
    })
  },
        /**
   * 托盘运单下车
   * @returns
   */
      carout (data = {}) {
        return request({
          url: 'sea/waybillTrayList/carout',
          method: 'post',
          data
        })
      },
            /**
   * 取消拦截
   * @returns
   */
     uintercept (data = {}) {
      return request({
        url: 'sea/waybillList/unintercept',
        method: 'post',
        data
      })
    },
            /**
   * 拦截
   * @returns
   */
    intercept (data = {}) {
      return request({
        url: 'sea/waybillList/intercept',
        method: 'post',
        data
      })
    },
}